package com.booking.springrestful.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 来访者心理健康评估表
 * @TableName userassessments
 */
@TableName(value ="userassessments")
@Data
public class Userassessments implements Serializable {
    /**
     * 唯一标识评估记录
     */
    @TableId(type = IdType.AUTO)
    private Integer assessmentid;

    /**
     * 关联用户ID
     */
    private Integer userid;

    /**
     * 预约记录id
     */
    private Integer appointmentid;

    /**
     * 评估结果
     */
    private Object results;

    /**
     * 创建时间
     */
    private Date createdat;

    /**
     * 更新时间
     */
    private Date updatedat;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Userassessments other = (Userassessments) that;
        return (this.getAssessmentid() == null ? other.getAssessmentid() == null : this.getAssessmentid().equals(other.getAssessmentid()))
            && (this.getUserid() == null ? other.getUserid() == null : this.getUserid().equals(other.getUserid()))
            && (this.getAppointmentid() == null ? other.getAppointmentid() == null : this.getAppointmentid().equals(other.getAppointmentid()))
            && (this.getResults() == null ? other.getResults() == null : this.getResults().equals(other.getResults()))
            && (this.getCreatedat() == null ? other.getCreatedat() == null : this.getCreatedat().equals(other.getCreatedat()))
            && (this.getUpdatedat() == null ? other.getUpdatedat() == null : this.getUpdatedat().equals(other.getUpdatedat()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAssessmentid() == null) ? 0 : getAssessmentid().hashCode());
        result = prime * result + ((getUserid() == null) ? 0 : getUserid().hashCode());
        result = prime * result + ((getAppointmentid() == null) ? 0 : getAppointmentid().hashCode());
        result = prime * result + ((getResults() == null) ? 0 : getResults().hashCode());
        result = prime * result + ((getCreatedat() == null) ? 0 : getCreatedat().hashCode());
        result = prime * result + ((getUpdatedat() == null) ? 0 : getUpdatedat().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", assessmentid=").append(assessmentid);
        sb.append(", userid=").append(userid);
        sb.append(", appointmentid=").append(appointmentid);
        sb.append(", results=").append(results);
        sb.append(", createdat=").append(createdat);
        sb.append(", updatedat=").append(updatedat);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}